//
//  NYSearchSectionFooterView.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/9.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYSearchSectionFooterView.h"

@interface NYSearchSectionFooterView ()

@property (nonatomic, strong) QMUIButton *clearButton;
@end


@implementation NYSearchSectionFooterView


- (instancetype)initWithReuseIdentifier:(nullable NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self initUI];
    }
    return self;
}
- (void)initUI {
    
    self.contentView.backgroundColor = UIColorMakeWithHex(@"#FFFFFF");
    [self.contentView addSubview:self.clearButton];
    
    [self.clearButton mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.bottom.top.equalTo(self.contentView);
    }];
}

#pragma mark - Target Methods
- (void)clearHistoryEvent:(QMUIButton *)sender {
    
    if (self.completeHandle) {
        self.completeHandle();
    }
}
#pragma mark - Public Methods

#pragma mark - Private Method

#pragma mark - Setter Getter Methods
- (QMUIButton *)clearButton {
    if (!_clearButton) {
        _clearButton = [[QMUIButton alloc] qmui_initWithImage:nil title:@"清除记录"];
        [_clearButton setTitleColor:UIColorMakeWithHex(@"#999999") forState:0];
        _clearButton.titleLabel.font = UIFontMake(13);
        [_clearButton addTarget:self action:@selector(clearHistoryEvent:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _clearButton;
}


@end
